# 下架
from selenium import webdriver
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.support.select import Select

driver = webdriver.Chrome()
driver.get('http://192.168.20.244/ecshop/admin/privilege.php?act=login')
driver.maximize_window()

driver.find_element(By.NAME,'username').send_keys('caichang')
driver.find_element(By.NAME,'password').send_keys('caichang1')
driver.find_element(By.ID,'tijiao').click()

#进去商品列表
driver.switch_to.frame('menu-frame')
driver.find_element(By.LINK_TEXT,'商品列表').click()

driver.switch_to.default_content()
driver.switch_to.frame('main-frame')

# actionChain = ActionChains(driver)
# for i in range('//*[@id="listDiv"]/table[1]/tbody/tr[4]/td[5]/img'):
#     # if src="images/yes.gif"
driver.find_element(By.XPATH, '//*[@id="listDiv"]/table[1]/tbody/tr[4]/td[5]/img').click()



